package com.villaday.idf.adapter3;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.widget.ImageView;

import com.villaday.idf.R;

import com.villaday.idf.base.AbsRecyclerViewAdapter;
import com.villaday.idf.model3.DataEntity;
import com.villaday.idf.model3.HashOrdersEntity;
import com.villaday.idf.util.ImageViewUtils;

public class ShopOrderBottomAdapter extends AbsRecyclerViewAdapter<HashOrdersEntity.BodyBean.ListBean.StepsBean> {


    public ShopOrderBottomAdapter(Context context) {
        super(context, R.layout.recycle_shop_order_bottom);
    }

    @Override
    public void onBindHolder(AbsRecyclerViewAdapter.RecyclerViewHolder holder, HashOrdersEntity.BodyBean.ListBean.StepsBean d, int position) {


        ImageView ivSob = (ImageView) holder.getView(R.id.iv_sob);
        if (d.getStatus().equals("success")) {
            ivSob.setImageResource(R.drawable.ic_select_normal);
            ImageViewUtils.setImageViewColor(ivSob, Color.argb(255, 255, 27, 28));
        } else {
            ivSob.setImageResource(R.drawable.shape_oval_stroke_eee_solid_white);
        }

        holder.bindTextView(R.id.tv_sob_title, d.getTitle());

        if (position == 0) {
            holder.getView(R.id.vw_sob).setVisibility(View.GONE);
        } else {
            holder.getView(R.id.vw_sob).setVisibility(View.VISIBLE);
        }
    }
}